package com.itheima.thread.blockingqueue.demo01;

import java.util.concurrent.ArrayBlockingQueue;

public class BlockingQueueDemo {

    public static void main(String[] args) throws InterruptedException {

        ArrayBlockingQueue arrayBlockingQueue = new ArrayBlockingQueue(2);

        arrayBlockingQueue.put("hello");
        arrayBlockingQueue.put("world");
//        arrayBlockingQueue.put("java");

        System.out.println(arrayBlockingQueue);

        System.out.println(arrayBlockingQueue.take());
        System.out.println(arrayBlockingQueue.take());
        System.out.println(arrayBlockingQueue.take());
    }
}
